<!DOCTYPE html>
<html>
<head>
    <title>OTC用户信息表</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("sportsuser:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("sportsuser:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("sportsuser:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
                <i-button type="warning" @click="updateDspcCard"><i class="fa fa-pencil-square-o"></i>&nbsp;修改DSPC</i-button>
                <i-button type="warning" @click="exportPort"><i class="fa fa-pencil-square-o"></i>&nbsp;导出列表</i-button>
            </div>
        </Row>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="sportsUser" :rules="ruleValidate" :label-width="150">
            <Form-item label="用户手机号" prop="phone">
                <i-input v-model="sportsUser.phone" placeholder="用户手机号" readonly="true"/>
            </Form-item>
            <Form-item label="昵称" prop="nickname">
                <i-input v-model="sportsUser.nickname" placeholder="昵称" readonly="true"/>
            </Form-item>
            <Form-item label="用户性别" prop="gender">
                <Radio-group v-model="sportsUser.gender">
                    <Radio label="0">
                        <span>男</span>
                    </Radio>
                    <Radio label="1">
                        <span>女</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="出生年月日 " prop="birthday">
                <i-input v-model="sportsUser.birthday" placeholder="出生年月日 " readonly="true"/>
            </Form-item>
            <Row>
                <i-col span="16">
                    <Form-item label="用户头像" prop="imageUrl">
                        <i-input v-model="sportsUser.img_url" placeholder="用户头像" readonly="true"/>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
                                max-size="2048"
                                :on-success="handleSuccess" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImagePicUrl">预览图片</i-button>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item label="用户住址" prop="address">
                <i-input v-model="sportsUser.address" placeholder="用户住址" readonly="true"/>
            </Form-item>
            <Form-item label="SPC总量" prop="totalSpc">
                <i-input v-model="sportsUser.totalSpc" placeholder="SPC总量" readonly="true"/>
            </Form-item>
            <Form-item label="已兑换SPC数量" prop="convert_spc">
                <i-input v-model="sportsUser.convert_spc" placeholder="已兑换SPC数量" readonly="true"/>
            </Form-item>
            <Form-item label="可兑换SPC数量" prop="spc">
                <i-input v-model="sportsUser.spc" placeholder="可兑换SPC数量" readonly="true"/>
            </Form-item>

            <Form-item label="DSPC总量" prop="totalDspc">
                <i-input v-model="sportsUser.totalDspc" placeholder="DSPC总量" readonly="true"/>
            </Form-item>
            <Form-item label="冻结DSPC数量" prop="lockdspc">
                <i-input v-model="sportsUser.lockdspc" placeholder="冻结DSPC数量" readonly="true"/>
            </Form-item>
            <Form-item label="可用DSPC数量" prop="dspc">
                <i-input v-model="sportsUser.dspc" placeholder="可用DSPC数量" readonly="true"/>
            </Form-item>
            <Form-item label="锁定" prop="islock">
                <Radio-group v-model="sportsUser.islock">
                    <Radio label="0">
                        <span>未锁定</span>
                    </Radio>
                    <Radio label="1">
                        <span>已锁定</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
    <Card  v-show="!showUpdate">
        <i-form  :label-width="150">
            <Form-item label="修改DSPC" prop="updateDspc" style="width: 80%" >
                <Input-number v-model="q.updateDspc" placeholder="请输入需更新的DSPC数量" style="width: 40%"  />
            </Form-item>
            <Form-item label="修改冻结DSPC" prop="updateLockDspc" style="width:80%" >
                <Input-number v-model="q.updateLockDspc" placeholder="请输入需更新的DSPC冻结数量" style="width: 40%" />
            </Form-item>
        </i-form>

        <i-button type="primary" @click="updateDspc">提交</i-button>
    </Card>
</div>

<script src="${rc.contextPath}/js/shop/sportsuser.js?_${date.systemTime}"></script>
</body>
</html>